import { AxiosResponse } from "axios";
import axiosInstance from "./request";

export interface LoginForm {
  username: string;
  password: string;
}
export interface LoginResponse {
  access_token: string;
}

export const postLoginReq = async (
  body: LoginForm
): Promise<AxiosResponse<LoginResponse>> => {
  const response: AxiosResponse<LoginResponse> = await axiosInstance.post(
    "/auth/login",
    body
  );
  return response;
};
